package com.heima.user.config;

import com.heima.user.interceptor.WebTokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class SystemMvcConfig implements WebMvcConfigurer {

    @Resource
    private WebTokenInterceptor webTokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(webTokenInterceptor).addPathPatterns("/api/**").excludePathPatterns("/api/v1/login/**");
    }
}
